﻿
<body bgcolor=ffffff>

<table width=100%>
  <tr>
    <td width=10>&nbsp;</td>

    <td>
      <table width=100%>
        <tr>
          <td>
            <h4>
            <%company%>
        <br><%address%>
            </h4>
          </td>

          <th></th>

          <td align=right>
            <h4>
            Тел: <%tel%>
        <br>Факс: <%fax%>
            </h4>
          </td>
        </tr>

        <tr>
          <th colspan=3>
	    <hr noshade><br>
            <h4>ПРОВОДКА ПРОДАЖ</h4>
          </th>
        </tr>
      </table>
    </td>
  </tr>

  <tr>
    <td>&nbsp;</td>

    <td>
      <table width=100% callspacing=0 cellpadding=0>
        <tr valign=top>
          <td><%name%>
          <br><%address1%>
	  <%if address2%>
          <br><%address2%>
	  <%end address2%>
          <br><%city%> <%state%> <%zipcode%>
	  <%if country%>
	  <br><%country%>
	  <%end country%>
          <br>

          <%if contact%>
          <br><%contact%>
          <br>
          <%end contact%>

          <%if customerphone%>
          <br>Tel: <%customerphone%>
          <%end customerphone%>

          <%if customerfax%>
          <br>Fax: <%customerfax%>
          <%end customerfax%>

          <%if email%>
          <br><%email%>
          <%end email%>
          </td>
   
	  <td align=right>
	    <table>
	      <tr>
		<th align=left nowrap>Счет-фактура No</th>
		<td><%invnumber%></td>
	      </tr>
	      <tr>
		<th align=left nowrap>Дата</th>
		<td><%invdate%></td>
	      </tr>
	      <tr>
		<th align=left nowrap>Оплата</th>
		<td><%duedate%></td>
	      </tr>
	      <tr>
		<th align=left>Заказ No</th>
		<td><%ordnumber%>&nbsp;</td>
	      </tr>
	      <tr>
		<th align=left nowrap>Продавец</th>
		<td><%employee%>&nbsp;</td>
	      </tr>
	    </table>
	  </td>
        </tr>
      </table>
    </td>
  </tr>

  <tr height=5></tr>
  
  <tr>
    <td>&nbsp;</td>
  
    <td>
      <table width=100%>
        <tr valign=top>
	  <td width=50%>
	    <table>
	      <%foreach account%>
	      <tr valign=top>
		<td><%accno%></td>
		<td><%account%></td>
		<td align=right><%amount%></td>
		<td><%projectnumber%></td>
	      </tr>
	      <%end account%>

	      <tr>
		<%if taxincluded%>
		<th colspan=2 align=right>Итого</th>
		<td align=right><%invtotal%></td>
		<%end taxincluded%>

		<%if not taxincluded%>
		<th colspan=2 align=right>Всего</th>
		<td align=right><%subtotal%></td>
		<%end taxincluded%>
	      </tr>

	      <%foreach tax%>
	      <tr>
		<th colspan=2 align=right><%taxdescription%> @ <%taxrate%> %</th>
		<td align=right><%tax%></td>
	      </tr>
	      <%end tax%>
	      
	      <%if not taxincluded%>
		<th colspan=2 align=right>Итого</th>
		<td align=right><%invtotal%></td>
	      <%end taxincluded%>

	    </table>
	  </td>
	  <td width=50%>
	    <%notes%>
	  </td>
	</tr>
      </table>
    </td>
  <tr>
    <td>&nbsp;</td>
    
  </tr>

  <tr>
    <td>&nbsp;</td>

    <td>
      <%text_amount%> 
    </td>
  </tr>

  <%if paid%>
  <tr>
    <td>&nbsp;</td>

    <td>
      <table>
        <tr>
          <th>Оплаты</th>
        </tr>

        <tr>
          <td>
          <hr noshade>
          </td>
        </tr>

	<tr>
	  <td>
	    <table>
	      <tr>
		<th align=left>Дата</th>
		<th align=left>Счет</th>
		<th align=left>Источник</th>
		<th align=left>Комментарий</th>
		<th align=left>Сумма</th>
	      </tr>
  <%end paid%>

        <%foreach payment%>
	      <tr>
		<td><%paymentdate%></td>
		<td><%paymentaccount%></td>
		<td><%paymentsource%></td>
		<td><%paymentmemo%></td>
		<td><%payment%></td>
	      </tr>
        <%end payment%>

  <%if paid%>
	    </table>
	  </td>
        </tr>
      </table>
    </td>
  </tr>
  <%end paid%>

  <tr height=10></tr>

  <%foreach tax%>
  <tr>
    <td>&nbsp;</td>

    <th colspan=9 align=left><font size=-2><%taxdescription%> Регистрация <%taxnumber%></th>
  </tr>
  <%end tax%>

  <%if taxincluded%>
  <tr>
    <td>&nbsp;</td>
  </tr>

  <tr>
    <th colspan=3 align=left><font size=-2>Цена с учетом налогов.</th>
  </tr>
  <%end taxincluded%>

</table>

</body>
</html>





